const { notEmpty , validatorResult } = require("./validator");

/**
 * 获取新朋友申请或加群申请 
 */
exports.get_new_friend_notify_validator = async (ctx,next) => {
    const errors = {};
    let result = notEmpty(ctx)(errors, "to_id", "query");
        await validatorResult(result,ctx,next); 
}

/**
 * 添加好友申请或加群申请记录 
 */
exports.add_friend_notify_validator = async (ctx,next) => {
    const errors = {};
        result = notEmpty(ctx)(errors,"from_id","body");
        result = notEmpty(ctx)(errors,"from_name","body");
        result = notEmpty(ctx)(errors,"from_avatar","body");
        result = notEmpty(ctx)(errors,"to_id","body");
        result = notEmpty(ctx)(errors,"type","body");
        await  validatorResult(result,ctx,next);
}

/**
 * 修改申请记录的状态(是否已同意) 
 */
exports.update_notify_status_validator = async (ctx,next) => {
    const errors = {};
    let result = notEmpty(ctx)(errors, "_id", "body");
        await validatorResult(result,ctx,next); 
}